<div class="admin_title_header clearfix">
  <h3>Coupons</h3>
  <%= link_to "New Coupon", new_admin_generic_coupon_path, class: 'button' %>
</div>
<div class="admin_coupons">
  <table class='hover'>
    <thead>
    <tr class='odd'>
      <th class='column1_header'>Code</th>
      <th>Type</th>
      <th>Starts at</th>
      <th>Expires at</th>
      <th></th>
    </tr>
    </thead>
    <% for coupon in @coupons %>
      <tr class='<%= cycle("odd", "")%>'>
        <td>
          <%= link_to coupon.code, admin_generic_coupon_path(coupon), style: "#{(coupon.expires_at <= Time.zone.now) ? 'color:#F65566' : ''}" %>
        </td>
        <td><%= coupon.type %></td>
        <td><%= coupon.display_start_time %></td>
        <td><%= coupon.display_expires_time %></td>
        <td><%= link_to "Edit", edit_admin_generic_coupon_path(coupon) %></td>
      </tr>
    <% end %>
  </table>
</div>
